package HomeWork1;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;
public class lj {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos=new FileOutputStream("./note.txt");
        Scanner s=new Scanner(System.in);
        System.out.println("请开始输入内容，单独输入EXIT退出");
        while ( true){
            String line = s.nextLine();
            if ("EXIT".equals(line)){
                break;
            }
            byte[] bytes=line.getBytes(StandardCharsets.UTF_8);
            fos.write(bytes);
        }
        System.out.println("拜拜");
        fos.close();
    }
}
